export const validRes = (res:string|object|null|undefined):(object|undefined)=>{
    if(typeof res === 'undefined'){
        return
    }
    if(res === null){
        return
    }
    if(typeof res === 'string'){
        try{
            const resJson = JSON.parse(res);
            return resJson.data?resJson.data:resJson;
        }catch(err){
            console.warn('【validRes】：返回数据格式转化失败！',res)
            console.error('【validRes】：返回数据格式转化失败！',err)
            return;
        }
    }
    if(typeof res === 'object'){
        return res.data?res.data:res;
    }
    return
}